class CreateCustomersPhones < ActiveRecord::Migration
  def self.up
    create_table :customers_phones do |t|
      t.integer :customer_id
      t.integer :phone_id
      t.integer :is_locked ,:limit => 1 ,:default => 0 #是否管理会要锁定 1为True 0为False
      t.timestamps
    end
    
    CustomersPhone.create(:customer_id => '1',:phone_id =>'1')
    CustomersPhone.create(:customer_id => '2',:phone_id =>'1')
    CustomersPhone.create(:customer_id => '1',:phone_id =>'2')
    CustomersPhone.create(:customer_id => '2',:phone_id =>'2')
  end
  
  def self.down
    drop_table :customers_phones
  end
end
